set(PICO_SDK_PATH "${USERHOME}/.pico-sdk/sdk/${sdkVersion}")
set(PICO_TOOLCHAIN_PATH "${USERHOME}/.pico-sdk/toolchain/${toolchainVersion}")

if (sdkVersion VERSION_LESS "2.0.0")
    if(WIN32)
        set(pico-sdk-tools_DIR "${USERHOME}/.pico-sdk/tools/${sdkVersion}")
        include(${pico-sdk-tools_DIR}/pico-sdk-tools-config.cmake)
        include(${pico-sdk-tools_DIR}/pico-sdk-tools-config-version.cmake)
    endif()
else()
    set(pioasm_HINT "${USERHOME}/.pico-sdk/tools/${sdkVersion}/pioasm")
    if(EXISTS ${pioasm_HINT})
        set(pioasm_DIR ${pioasm_HINT})
    endif()
    set(picotool_HINT "${USERHOME}/.pico-sdk/picotool/${picotoolVersion}/picotool")
    if(EXISTS ${picotool_HINT})
        set(picotool_DIR ${picotool_HINT})
    endif()
    if(PICO_TOOLCHAIN_PATH MATCHES "RISCV")
        set(PICO_PLATFORM rp2350-riscv CACHE STRING "Pico Platform")
        if(PICO_TOOLCHAIN_PATH MATCHES "RISCV_ZCB")
            set(PICO_COMPILER "pico_riscv_gcc_zcb_zcmp")
        endif()
    endif()
endif()
